package cmd.commands;

import model.Player;
import model.Settings;
import util.PlayerUtilities;

public class ResetPlayerCommand extends Command {

	public ResetPlayerCommand(Command c) {
		super(c.command, c.parameters);
	}

	@Override
	public boolean execute() {
		PlayerUtilities.recursiveDelete(Settings.XML_DIRECTORY);
		PlayerUtilities.recursiveDelete(Settings.VIDEO_DIRECTORY);
		PlayerUtilities.recursiveDelete(Settings.IMAGE_DIRECTORY);
		PlayerUtilities.recursiveDelete(Settings.HTML_DIRECTORY);
		//PlayerUtilities.recursiveDelete(Settings.LOG_DIRECTORY);
		PlayerUtilities.createDirectories();
		Player.getInstance().resetPlayer();
		//Player.getInstance().update();
		System.out.println("RESET PLAYER COMMAND EXECUTED");
		PlayerUtilities.setUpdateStringJson("RESET_PLAYER",0);
		return true;
	}

}
